﻿#include<iostream>
using namespace std;
int main() {
	int password{ 85161561 };
	int crackPass{};

	//goto
lcrack:
	if (crackPass != password) {
		crackPass++;
		goto lcrack;

	}
	cout << "路由器PIN=" << crackPass << endl;

	//for1
	for (crackPass = 0; crackPass < 100000000; crackPass++) {
		if (crackPass == password)break;
	}
	cout << "路由器PIN=" << crackPass << endl;

	//for2，代码直观，涉及具体执行次数的时候用,汇编为先mov再add再cmp je
	for (crackPass = 0; crackPass != password; crackPass++);
	cout << "路由器PIN=" << crackPass << endl;

	//while，原则比for高，但是涉及具体执行次数不直观,汇编为mov cmp je再jmp
	crackPass = 0;
	while (crackPass != password)crackPass++;
	cout << "路由器PIN=" << crackPass << endl;

	//do while,执行效率最高，6行汇编
	crackPass = -1;
	do crackPass++; while (crackPass != password);
	cout << "路由器PIN=" << crackPass << endl;
}

//for < goto while < do while